/*
 * @lc app=leetcode.cn id=206 lang=golang
 *
 * [206] 反转链表
 */

// @lc code=start
/**
 * Definition for singly-linked list.
 * type ListNode struct {
 *     Val int
 *     Next *ListNode
 * }
 */
func reverseList(head *ListNode) *ListNode {
    node := &ListNode{}
	for head != nil{
		temp := head
		head = head.Next
		temp.Next = node.Next
		node.Next = temp
	}
	return node.Next

}
// @lc code=end

